/*
 * @Description: 
 * @Author: zhanyinjia
 * @Date: 2022-07-04 16:03:57
 * @LastEditors: zhanyinjia
 * @LastEditTime: 2023-12-10 10:10:02
 */
const chalk = require("chalk")

console.log(chalk.black.bgHex('#faad14').bold(`当前环境：${process.env.VUE_APP_ENV}`))

module.exports = {
  publicPath: '/',
  // outputDir: '../manage_platform_dist/dist',
  outputDir: './dist',
  assetsDir: 'static',
  parallel: require('os').cpus().length > 1, //cpu多于1核启动并行压缩
  lintOnSave: process.env.NODE_ENV === 'development' ? false : false,
  productionSourceMap: false,
  pwa: {
    iconPaths: {
      favicon16: 'favicon.ico',
      favicon32: 'favicon.ico',
      appleTouchIcon: 'favicon.ico',
      maskIcon: 'favicon.ico',
      msTileImage: 'favicon.ico',
    }
  },
  devServer: {
    // 服务器主机名，如果允许外部访问，可设置为 "0.0.0.0"
    host: "0.0.0.0",
    port: 8090,
    open: true,
    hot: true
  },
  configureWebpack: (config) => {
    config.devtool = "source-map"
    return {
      externals: [{
        './cptable': 'var cptable'
      }]
    }
  }
}